//
//  BankViewController.m
//  CarStore
//
//  Created by 千锋 on 16/1/25.
//  Copyright (c) 2016年 1000phone. All rights reserved.
//

#import "BankViewController.h"
#import "BankDetailViewController.h"
@interface BankViewController ()

@end

@implementation BankViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.tableView.bounces = NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    BankDetailViewController *bankVC = [[BankDetailViewController alloc] init];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Bank" ofType:@"plist"];
    NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:path];
    NSString *detail;
    NSString *title;
    switch (indexPath.row) {
        case 0:
            detail = dic[@"zhongguo"];
            title = dic[@"zhongguotitle"];
            break;
        case 1:
            detail = dic[@"huaqi"];
            title = dic[@"huaqititle"];
            break;
        case 2:
            detail = dic[@"jiangsu"];
            title = dic[@"jiangsutitle"];
            break;
        case 3:
            detail = dic[@"nanjing"];
            title = dic[@"nanjingtitle"];
            break;
        case 4:
            detail = dic[@"pingan"];
            title = dic[@"pingantitle"];
            break;
            default:
            break;
    }
    bankVC.detail = detail;
    bankVC.detailTitle = title;
    
    [self push:^{
        [self.navigationController pushViewController:bankVC animated:YES];
    }];
}
// 隐藏控制栏
- (void)push:(void(^)(void))push
{
    self.hidesBottomBarWhenPushed = YES;
    push();
    self.hidesBottomBarWhenPushed = NO;
}


@end
